<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j">


    <body>

        <ui:composition template="./templates/plantilla.xhtml">

	    <ui:define name="top">
		<h:graphicImage url="/resourses/images/header.png"></h:graphicImage>
		<h:form id="formMenu">
		    <!-- <rich:panel> -->
		    <rich:toolbar height="26px" >
			<rich:menuItem action="#{cargarPaginaBean.cambiarPageInclude}"  mode="ajax" render="panelContenido" execute="@form">
			    <h:outputText value="INICIO" />
			    <f:param name="current" value="Inicio"/>
			    <a4j:ajax event="click" execute="@form"  render="panelContenido"></a4j:ajax>
			</rich:menuItem>
			<rich:dropDownMenu mode="ajax">
			    <f:facet name="label">
				<h:panelGrid cellpadding="0" cellspacing="0" columns="2"
					     style="vertical-align:middle">
				    <h:outputText value="GESTIÓN" />
				</h:panelGrid>
			    </f:facet>
			    <rich:menuItem action="#{cargarPaginaBean.cambiarPageInclude}" render="panelContenido" execute="@form">
				<h:outputText value="Personas" />
				<f:param name="current" value="Personas"/>
				<a4j:ajax event="click" execute="@form" render="panelContenido"></a4j:ajax>
			    </rich:menuItem>
			    <rich:menuItem action="#{cargarPaginaBean.cambiarPageInclude}" render="panelContenido" execute="@form">
				<h:outputText value="Procesos" />
				<f:param name="current" value="Procesos"/>
				<a4j:ajax event="click" execute="@form" render="panelContenido"></a4j:ajax>
			    </rich:menuItem>
			    <rich:menuItem action="#{cargarPaginaBean.cambiarPageInclude}" render="panelContenido" execute="@form">
				<h:outputText value="Tipo Persona" />
				<f:param name="current" value="TipoPersona"/>
				<a4j:ajax event="click" execute="@form" render="panelContenido"></a4j:ajax>
			    </rich:menuItem>
			</rich:dropDownMenu>
		    </rich:toolbar>
		    <!-- </rich:panel> -->
		</h:form>
	    </ui:define>

            <ui:define name="content">
		<h:form>
		    <a4j:outputPanel ajaxRendered="true" >
			<rich:panel id="panelContenido" style="width: 895px; height: 400px;">
			    <a4j:outputPanel ajaxRendered="true">
				<ui:include src="./#{cargarPaginaBean.pageInclude}"></ui:include>
			    </a4j:outputPanel>
			</rich:panel>
		    </a4j:outputPanel>
		</h:form>
            </ui:define>

	    <ui:define name="bottom">
		<h:graphicImage url="/resourses/images/footer.png"></h:graphicImage>
	    </ui:define>

        </ui:composition>

    </body>
</html>
